﻿@model Kavaa.Modules.PortailMedical.Presentation.Models.MyViewModel
@{
   ViewBag.Title = "FichePatient";
    //Layout = "~/Views/shared/_BootstrapLayout.basic.cshtml";

}
@using System.Web.Optimization
@using BootstrapSupport
@using NavigationRoutes
<script>

    window.onload = function () {
        var txts = document.getElementsByTagName('remarquesPatient')

        for (var i = 0, l = txts.length; i < l; i++) {
            if (/^[0-9]+$/.test(txts[i].getAttribute("maxlength"))) {
                var func = function () {
                    var len = parseInt(this.getAttribute("maxlength"), 10);

                    if (this.value.length > len) {
                        alert('Maximum length exceeded: ' + len);
                        this.value = this.value.substr(0, len);
                        return false;
                    }
                }

                txts[i].onkeyup = func;
                txts[i].onblur = func;
            }
        }
    }
    function msgSuccess()
    {
        document.getElementById("msgSucces").style.display = "block";

    }
</script>
<style>

    .the-legend {
    border-style: none;
    border-width: 0;
    font-size: 14px;
    line-height: 20px;
    margin-bottom: 0;
}
.the-fieldset {
    border: 2px groove threedface #444;
    -webkit-box-shadow:  0px 0px 0px 0px #000;
            box-shadow:  0px 0px 0px 0px #000;
}
.fieldset {
    border: 1px solid #ccc;
    padding: 10px;
}

</style>
  <div class="container" style="background-color:white" >
      
     
         <div class="navbar">
            <div class="navbar-inner">
      <div class="container">
        <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
          <div class="nav-collapse collapse">
        <ul class="nav">
      <li > @Html.ActionLink("Accueil","AccueilCabinet")</li>
      <li > @Html.ActionLink("Accréditation","Accreditation")</li>
      <li class="active">@Html.ActionLink("Réservation","AccueilReservation")</li>
      <li><a href="#">Rapports d'interventions</a></li>
      <li>@Html.ActionLink("Comptes Cabinet","ComptesCabinet")</li>
  
    </ul>
            <form class="navbar-search pull-right">
      <i class="icon-search"></i>
  <input type="text" class="search-query" placeholder="Search">
</form>
  </div>
          </div>
      </div>
             </div>
      <div  style="margin:50px">
         <b style="color:blue"> < </b> <u> <b>  @Html.ActionLink("Retour au Calendrier","EtatReservations") </b> </u>
    <br />
    <br />
         @{var id=@ViewBag.idreserv;
           var datedebut = @ViewBag.datedebut;
           var datefin=@ViewBag.datefin;
           var clinique = @ViewBag.clinique;
           var ville = @ViewBag.ville;
           }
    Cette fiche concerne la réservation prévue du @datedebut au @datefin  chez la clinique @clinique (@ville).<br />
    Remplissez cette fiche par les informations du patient concerné. Cette fiche une fois remplie sera transmise à la clinique.
  
               <br />
    <br />
           <div id="msgSucces" class="alert alert-info" style="display:none">
                 Ces informations seront accessibles à la clinique dès que le patient se présentera avec cette convocation.
           </div>



@using (Ajax.BeginForm("SavePatient", "Cabinet", new AjaxOptions {HttpMethod="Post", OnSuccess = "msgSuccess" }))
{  
            
<input type="hidden" name="idReserv" value=@id />
     <fieldset class="well fieldset">
          <legend >Fiche patient</legend>
  <table>
  <tr>
    <td style="color:darkblue;text-decoration:solid"> <h5>Nom :</h5> </td>
  
    <td>    @Html.EditorFor(model => model.Patient.Name)
            @Html.ValidationMessageFor(model => model.Patient.Name)<br /></td>
  </tr>
   <tr>
    <td style="color:darkblue;text-decoration:solid"> <h5>Prénom :</h5> </td>
    <td>  @Html.EditorFor(model => model.Patient.Prenom)
            @Html.ValidationMessageFor(model => model.Patient.Prenom)<br /></td>
  </tr>
      <tr>
    <td style="color:darkblue;text-decoration:solid"> <h5>CIN :</h5> </td>
    <td>  @Html.EditorFor(model => model.Patient.CIN)
            @Html.ValidationMessageFor(model => model.Patient.CIN)<br /></td>
  </tr>
   <tr>
    <td style="color:darkblue;text-decoration:solid"> <h5>Age:</h5> </td>
    <td>  @Html.EditorFor(model => model.Patient.Age)
            @Html.ValidationMessageFor(model => model.Patient.Age)<br /></td>
  </tr> 
      @{ var mutuelles = new SelectList(@ViewBag.mutuelles, "Id", "Sigle");
         }
  <tr>
    <td style="color:darkblue;text-decoration:solid"> <h5>Mutuelle :</h5> </td>
    <td>     @Html.DropDownListFor(model => model.Mutuelle.Id, @mutuelles, "--Choix")<br />
        
    </td>
  </tr>
   <tr>
    <td style="color:darkblue;text-decoration:solid;vertical-align:text-top"> <h5>Remarques Médicales:</h5> </td>
    <td><textarea maxlength="50" style="width:600px" rows="15" cols="70" name="remarquesPatient"></textarea><br /></td>
  </tr>
   </table>
         <br />
         <br />
      <button class="btn" onclick="/Cabinet/EtatReservations">Annuler</button>
      <button class="btn" type="submit">Générer convocation</button>
  </fieldset>  
    
}</div>
    </div>



